package org.lds.hotkey.console.business.currhotkey.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.lds.hotkey.console.business.currhotkey.entity.CurrHotKey;
import org.lds.hotkey.console.business.currhotkey.mapper.CurrHotKeyMapper;
import org.lds.hotkey.console.business.currhotkey.service.CurrHotKeyService;
import org.springframework.stereotype.Service;

/**
 *  服务实现类
 *
 * @author lidongsheng
 * @since 2024-07-15
 */
@Service
public class CurrHotKeyServiceImpl extends ServiceImpl<CurrHotKeyMapper, CurrHotKey> implements CurrHotKeyService {

    @Override
    public void clearExpiredData() {
        QueryWrapper<CurrHotKey> queryWrapper = new QueryWrapper<>();
        queryWrapper.lt("expire_time", System.currentTimeMillis());
        baseMapper.delete(queryWrapper);
    }
}
